package com.ktjy.crm.thymeleaf.controller;

import com.ktjy.crm.thymeleaf.entity.SysUser;
import com.ktjy.crm.thymeleaf.service.IUserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
public class ExampleController {
    @Resource
    IUserService userService;
    @GetMapping(value = "/hello/{id}")
    public String hello(@PathVariable Long id, Model model) {
        SysUser user = userService.getUser(id);
        model.addAttribute("user", user);
        return "demo/hello";
    }
}
